import 'package:flutter/material.dart';
import 'package:wan_android_flutter/repository/Api.dart';

import '../../repository/datas/knowledge_list_model.dart';

class KnowledgeViewModel with ChangeNotifier{
   List<KnowledgeModel?>? knowledgeList;

   Future getKnowledgeList() async{
     knowledgeList = await Api.instance().knowledgeList();
      notifyListeners();
   }
   String getGeneralSubTitle(List<KnowledgeChildren>? childrens){
    if(childrens ==null && childrens?.isEmpty ==true){
      return "";
    }
    StringBuffer stringBuffer =StringBuffer("");
    childrens?.forEach((item){
      stringBuffer.write("${item.name} ");
    });
    return stringBuffer.toString();
   }
}